<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
  <title>类友网络-动态</title>
  <link rel="stylesheet" href="{{ url_for('static', filename='layui/css/layui.css') }}">
  <link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
</head>
<body>
  <!-- nav部分 -->
  <div class="nav">
    <div class="layui-container">
      <!-- 公司logo -->
      <div class="nav-logo">
        <a href="/">
          <img src="{{ url_for('static', filename='img/logo.png') }}" alt="类友网络">
        </a>
      </div>
      <div class="nav-list">
        <button>
          <span></span><span></span><span></span>
        </button>
        <ul class="layui-nav" lay-filter="">
          <li class="layui-nav-item"><a href="/">首页</a></li>
          <li class="layui-nav-item"><a href="product">产品</a></li>
          <li class="layui-nav-item layui-this"><a href="news">动态</a></li>
          <li class="layui-nav-item"><a href="case">案例</a></li>
          <li class="layui-nav-item"><a href="about">关于</a></li>
        </ul>
      </div>
    </div>
  </div>
  <!-- banner部分 -->
  <div class="banner news">
    <div class="title">
      <p>实时新闻</p>
      <p class="en">Real-time News</p>
    </div>
  </div>
  <!-- main -->
  <div class="main-news">
    <div class="layui-container">
      <div class="layui-row layui-col-space20">
        {% for list in lists['data'] %}
        <div class="layui-col-lg6 content">
          <div>
            <div class="news-img"><a href="{{ url_for('detail') }}?id={{ list['_id'] }}"><img src="{{ list['cover'] }}"></a></div><div class="news-panel">
              <strong><a href="{{ url_for('detail') }}?id={{ list['_id'] }}">{{ list['title'] }}</a></strong>
              <pre style="color: #777;line-height: 24px;overflow: hidden;height: 72px;">{{ list['desc'] |safe }}</pre>
{#               <p class="read-push">发布时间：<span>{{ list['_createTime'] }}</span></p>#}
            </div>
          </div>
        </div>
        {% endfor %}
      </div>
      <div id="newsPage"></div>
    </div>
  </div>
  <!-- footer部分 -->
  <div class="footer">
    <div class="layui-container">
      <p class="footer-web">
        <a href="javascript:;">合作伙伴</a>
        <a href="javascript:;">企业画报</a>
        <a href="javascript:;">JS网</a>
        <a href="javascript:;">千图网</a>
        <a href="javascript:;">昵图网</a>
        <a href="javascript:;">素材网</a>
        <a href="javascript:;">花瓣网</a>
      </p>
      <div class="layui-row footer-contact">
        <div class="layui-col-sm2 layui-col-lg1"><img src="/static/img/erweima.jpg"></div>
        <div class="layui-col-sm10 layui-col-lg11">
          <div class="layui-row">
            <div class="layui-col-sm6 layui-col-md8 layui-col-lg9">
              <p class="contact-top"><i class="layui-icon layui-icon-cellphone"></i>&nbsp;400-8888888&nbsp;&nbsp;&nbsp;(9:00-18:00)</p>
              <p class="contact-bottom"><i class="layui-icon layui-icon-home"></i><span>&nbsp;88888888@163.com</span></p>
            </div>
            <div class="layui-col-sm6 layui-col-md4 layui-col-lg3">
              <p class="contact-top"><span class="right">浙江杭州阿里巴巴西溪园区</span></p>
              <p class="contact-bottom"><span class="right">Copyright&nbsp;©&nbsp;2016-2018&nbsp;&nbsp;ICP&nbsp;备888888号</span></p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
<script src="{{ url_for('static', filename='layui/layui.js') }}"></script>
<!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>

  layui.config({
    base: '{{ url_for('static', filename='js/') }}'
  }).use(['firm','laypage','mymod'], function(){
  var laypage = layui.laypage, mymod = layui.mymod;

  //执行一个laypage实例
  laypage.render({
    elem: 'newsPage' //注意，这里的 test1 是 ID，不用加 # 号
    ,count: {{ lists['total'] }} //数据总数，从服务端得到
    ,limit:8
      ,curr: mymod.getQueryVariable("p")
      ,jump: function(obj, first){


        //首次不执行
        if(!first){
          //do something
              location.href="/news?p="+obj.curr;
        }
      }
  });
});
</script>

</body>
</html>